package 剑指offer;

public class _54二叉树的第k大节点 {
    int i = 0;
    int res = 0;
    public int kthLargest(TreeNode root, int k) {
        if(root == null){
            return res;
        }
        kthLargest(root.right,k);
        i++;
        if(i == k){
            res = root.val;
            return res;
        }
        kthLargest(root.left,k);
        return res;
    }
}
